Gather printing routines into EVP_PKEY_ASN1_METHOD.
[openssl.git] / ssl / d1_enc.c
index 7b369644ff8fbbbe8247772e4ade44706c4270c4..cbff7495c502a45c91f27db3d9268bb849329dba 100644 (file)
@@ -146,7 +146,10 @@ int dtls1_enc(SSL *s, int send)
                                fprintf(stderr, "%s:%d: rec->data != rec->input\n",
                                        __FILE__, __LINE__);
                        else if ( EVP_CIPHER_block_size(ds->cipher) > 1)
-                               RAND_bytes(rec->input, EVP_CIPHER_block_size(ds->cipher));
+                               {
+                               if (!RAND_bytes(rec->input, EVP_CIPHER_block_size(ds->cipher)))
+                                       return -1;
+                               }
                        }
                }
        else
@@ -217,7 +220,7 @@ int dtls1_enc(SSL *s, int send)
                        {
                        if (l == 0 || l%bs != 0)
                                {
-                               SSLerr(SSL_F_TLS1_ENC,SSL_R_BLOCK_CIPHER_PAD_IS_WRONG);
+                               SSLerr(SSL_F_DTLS1_ENC,SSL_R_BLOCK_CIPHER_PAD_IS_WRONG);
                                ssl3_send_alert(s,SSL3_AL_FATAL,SSL_AD_DECRYPTION_FAILED);
                                return 0;
                                }