Commit 0a41f178 authored by michael.simon's avatar michael.simon
Browse files

validation works with rsa keys. ssh-ed25519 not working

parent a2335f6f
......@@ -81,8 +81,8 @@ public class OpenSshKeyDecoder implements Serializable {
private int decodeInt(OpenSshPublicKey key) {
byte[] bytes = key.getBytes();
int pos = key.getDecoderPos();
int header = ((bytes[pos] & 0xFF) << 24) | ((bytes[pos] & 0xFF) << 16)
| ((bytes[pos] & 0xFF) << 8) | (bytes[pos] & 0xFF);
int header = ((bytes[pos] & 0xFF) << 24) | ((bytes[pos+1] & 0xFF) << 16)
| ((bytes[pos+2] & 0xFF) << 8) | (bytes[pos+3] & 0xFF);
key.increaseDecoderPos(4);
return header;
}
......
......@@ -23,16 +23,34 @@
<ui:param name="title" value="#{messages.title}"/>
<ui:define name="content">
<h:form>
<h:form id="form" prependId="false">
<p:panel header="#{messages.ssh_key_management}">
<div><p:messages showDetail="true" /></div>
<div class="panel">
<div class="panel">#{messages.my_data_explanation}</div>
<div class="panel">#{messages.data_from}: <b>#{userPropertiesBean.idpEntity.orgName}</b></div>
<p:panelGrid id="baseData" columns="2">
<bw:outputText label="#{messages.name}" value="#{userPropertiesBean.user.surName}, #{userPropertiesBean.user.givenName}"/>
<bw:outputText label="#{messages.eppn}" value="#{userPropertiesBean.user.eppn}"/>
</p:panelGrid>
</div>
<p:panelGrid id="baseData" columns="2">
<h:outputText value="#{messages.ssh_key}:"/>
<h:panelGroup>
<ul>
<ui:repeat var="key" value="#{userSshKeyManagementBean.keyList.toArray()}">
<li><h:outputText value="#{key.publicKey}"/></li>
</ui:repeat>
</ul>
</h:panelGroup>
<h:outputText value="#{messages.add_ssh_key}:"/>
<p:inputTextarea value="#{userSshKeyManagementBean.newKey}" style="width: 600px; height: 100px;"
autoResize="false" />
</p:panelGrid>
<p:commandButton id="add" action="#{userSshKeyManagementBean.deployKey()}" value="#{messages.add}" update="@form" />
<p:ajaxStatus id="ajaxStatusPanel" style="display: inline-block; margin-left: 8px; vertical-align: baseline;">
<f:facet name="start">
<h:graphicImage value="#{resource['/img/ajax-loader.gif']}" alt="#{messages.loading}"/>
</f:facet>
<f:facet name="complete">
<h:outputText value="" />
</f:facet>
</p:ajaxStatus>
</p:panel>
</h:form>
</ui:define>
</ui:composition>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment